<?php

namespace App\Services;

use App\Models\SysReport;

/**
 * @package App\Services
 * @see ReportService
 */
class ReportService extends BaseService
{
    private $_repository;

    public function __construct()
    {
        parent::__construct();
        $this->_repository = repository()->ReportRepository;
    }

    public function getReportCategoryList($searchParams)
    {
        $dataProvider = $this->_repository->getCategoryList($searchParams);
        $pagination = $this->getPagination();
        $categories = $dataProvider->get();

        return self::outputMoreList($dataProvider, $pagination, $categories);
    }

    /**
     * 新增举报
     * @param $params
     * @return SysReport|bool
     */
    public function addReport($params)
    {
        return $this->_repository->create($params);
    }
}
